import {createRouter, createWebHistory, RouteRecordRaw} from 'vue-router'


const routes: Array<RouteRecordRaw> = [
        {
        
          path:"/",
          redirect:"/login"
        },
        {
          name:"login",
          path:"/login",
          component:()=>import("@/views/Login/index.vue")
        },
        {
          name:"layout",
          path:"/layout",
          component:()=>import("@/views/layout/index.vue"),
          children:[
            { //文章分类
              name:"newscate",
              path:"newscate",
              component:()=>import("@/views/newsCate/index.vue")
            },
             { //文章管理
              name:"newslist",
              path:"newslist",
              component:()=>import("@/views/newslist/index.vue")
            },
              { //头像管理
              name:"avator",
              path:"avator",
              component:()=>import("@/views/avator/index.vue")
            },
             { //用户资料
              name:"userinfo",
              path:"userinfo",
              component:()=>import("@/views/userInfo/index.vue")
            },
              { //修改密码
              name:"editpass",
              path:"editpass",
              component:()=>import("@/views/editPassword/index.vue")
            }          
          ]
        }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
